package service;

import domain.CartItem;
import domain.LineItem;
import domain.Order;
import persistence.OrderDao;
import persistence.impl.OrderDaoImpl;

import java.util.List;

public class OrderService {
    private OrderDao orderDao;
    private CartItem cartItem;

    public OrderService(){
        this.orderDao=new OrderDaoImpl();
        this.cartItem=new CartItem();
    }

    public List<Order> getOrderByUserId(String userid){
        return orderDao.getOrdersByUserId(userid);
    }

    public void insertOrder(Order order){
        orderDao.insertOrder(order);
    }
    public void insertOrderStatus(Order order){
        orderDao.insertOrderStatus(order);
    }

    public Order getOrderByOrderId(int orderid){
        return orderDao.getOrderByOrderId(orderid);
    }

    public void setNotRepeatOrderId(Order order){
        orderDao.setNotRepeatOrderId(order);
    }
    public void insertOrderItem(Order order){
        orderDao.insertOrderItem(order);
    }
    public List<LineItem> getLineItemByOrderId(int orderid){
        return orderDao.getLineItemByOrderId(orderid);
    }
}
